import { useLocation } from "react-router-dom";
import { useState } from "react";

export default function useRouterLink() {
  const [path, setPath] = useState<string>("")
//  获取当前的router
  const location = useLocation();

  console.log(`当前路由为：${location.pathname}`);
  setPath(location.pathname);

  return {path, setPath};
}
